<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <style>
        /* 不限层级 */
        div p{
            background-color: pink;
        }
        div span{
            color: red;
        }
        div ul p span{
            background-color: yellow;
        }
        /* 子代选择器  */
        div>span{
            background-color: green;
        }
    </style>
    <p>1111</p>
    <div>
        <p>2222</p>
        <span>aaa</span>
        <ul>
            <p>333
                <span>bbb</span>
            </p>
        </ul>
    </div>
    <hr>
    <style>
        h3~li{
            background-color: pink;
        }
    </style>
    <ol>
        <li>1111</li>
        <h3>3333</h3>
        <li>1111</li>
        <p>段落</p>
        <li>1111</li>
    </ol>
    <hr>
    <style>
        h4+li{
            background-color: yellow;
        }

    </style>
    <ul>
        <li>aaaa</li>
        <h4>标题4</h4>
        <li>bbb</li>
        <p>pppp</p>
        <li>cccc</li>
    </ul>
</body>
</html>